/**
 * Copyright &copy; 2012-2016 <a href="https://istep.lczyfz.com">Istep</a> All rights reserved.
 */
package com.lczyfz.istep.modules.race.service;

import java.util.List;

import com.lczyfz.istep.modules.race.entity.RaceUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lczyfz.istep.common.persistence.Page;
import com.lczyfz.istep.common.service.CrudService;
import com.lczyfz.istep.modules.race.entity.RaceTeam;
import com.lczyfz.istep.modules.race.dao.RaceTeamDao;

/**
 * 竞赛团队列表Service
 * @author CY
 * @version 2017-04-17
 */
@Service
@Transactional(readOnly = false)
public class RaceTeamService extends CrudService<RaceTeamDao, RaceTeam> {

	@Autowired
	RaceTeamDao raceTeamDao;



	public RaceTeam get(String id) {
		return super.get(id);
	}
	
	public List<RaceTeam> findList(RaceTeam raceTeam) {
		return super.findList(raceTeam);
	}
	
	public Page<RaceTeam> findPage(Page<RaceTeam> page, RaceTeam raceTeam) {
		return super.findPage(page, raceTeam);
	}
	
	@Transactional(readOnly = false)
	public void save(RaceTeam raceTeam) {
		super.save(raceTeam);
	}
	
	@Transactional(readOnly = false)
	public void delete(RaceTeam raceTeam) {
		super.delete(raceTeam);
	}


	// 获取所有竞赛成员
	public List<RaceUser> findAllListUser(){
		return  raceTeamDao.findAllListUser();
	}

	//团队详情
	public  List<RaceUser> teamDetails(String teamId){
		return  raceTeamDao.teamDetails(teamId);
	}

	public  RaceTeam findTeamId(String tid){
		return raceTeamDao.findTeamId(tid);
	}
    public  void raceUserTeam(RaceTeam raceTeam){
	  raceTeamDao.raceUserTeam(raceTeam);
       }
   public void deleteRaceUserId(String userId){
	   raceTeamDao.deleteRaceUserId(userId);
   }
	public  void updateRaceUserId(RaceTeam raceTeam){
		raceTeamDao.updateRaceUserId(raceTeam);
	}
   public  List<RaceTeam> selectRaceTeamId(String teamId){
	   return  raceTeamDao.selectRaceTeamId(teamId);
   }

	public RaceTeam findUserTeam(String userId) {
	  return raceTeamDao.findUserTeam(userId);
  }

	//查询所有队伍
	public List<RaceTeam> findAllTeam() {
		return raceTeamDao.findAllTeam();
	}

	public List<RaceTeam> findByName(String teamName) {
		return raceTeamDao.findByName(teamName);
	}

}